@ECHO OFF

REM // Label indicating the beginning of the document 
:BEGIN

REM // Sets the current configuration (Debug or Release)
SET currentConfig=Debug

REM // Sets the current version of the library
:APIKEY
ECHO Insert the current version and press enter...
SET apiKey=
set /P apiKey=Type APIKEY: %=%
if "%apiKey%"=="" goto APIKEY

REM // Sets the current version of the library
:VERSION
ECHO Insert the current version and press enter...
SET currentVersion=
set /P currentVersion=Type VERSION: %=%
if "%currentVersion%"=="" goto VERSION

REM // Sets the library build path
SET buildPath=D:\Documents\Repository\Mercurial\UtfprLibrary\build

REM // Verify if the build path exists
IF EXIST "%buildPath%" (
  ECHO Publishing packages...
  ECHO Config: %currentConfig%
  ECHO Version: %currentVersion%
  ECHO BuildPath: %buildPath%
  ECHO.
) ELSE (
  ECHO "Error, build path not found!" 
  GOTO END
)

SET corePath=%buildPath%\UtfprLibrary.Core\bin\%currentConfig%\UTFPRLibrary.Core.%currentVersion%.nupkg
SET efPath=%buildPath%\UtfprLibrary.EntityFramework\bin\%currentConfig%\UTFPRLibrary.EntityFramework.%currentVersion%.nupkg
SET wfCorePath=%buildPath%\UtfprLibrary.WindowsForms.Core\bin\%currentConfig%\UTFPRLibrary.WindowsForms.Core.%currentVersion%.nupkg
SET wfPath=%buildPath%\UtfprLibrary.WindowsForms\bin\%currentConfig%\UTFPRLibrary.WindowsForms.%currentVersion%.nupkg

NUGET PUSH %corePath% %apiKey%
NUGET PUSH %efPath% %apiKey%
NUGET PUSH %wfCorePath% %apiKey%
NUGET PUSH %wfPath% %apiKey%

REM // Label indicating the end of the document 
:END

ECHO Finished packages publication attempt!